﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ArticleList.aspx.cs" Inherits="hcms.Admin.ArticleList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>文档列表</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<link href="Styles/rightframe.css" rel="stylesheet" type="text/css" />
	<script src="/Scripts/jquery.min.161.js" type="text/javascript"></script>
	<script src="js/admin.js" type="text/javascript"></script>
	<script type="text/javascript">
		function ondelete() {
			if (getcheckedstrid() == false)
				return;

			if (confirm('可能有多个栏目拥有这些文档，确定删除?\r\n如果只删除当前栏目中的文档，请点取消后进入文档编辑，选择相应的栏目后保存。')) {
				$("#cmd").val("delete");
				form1.submit();
			}
		}

		function onitemlist() {
			$("#cmd").val("itemlist");
			form1.submit();
		}

		function onedit() {
			var editid = getfirstchecked();
			if (!editid)
				return;

			window.location = "ArticleEdit.aspx?cid=<%=cid%>&aid=" + editid;
		}

		$("#pager").ready(function () {
			HPages({ ctrlid: "#pager", page: <%=page%>, pages: <%=pages %>,
				gopage: function (pa) {
					window.location = "ArticleList.aspx?cid=<%=cid%>&page=" + pa;
				}
			});
		});
	</script>
</head>
<body>
    <form id="form1" runat="server">
	<input type="hidden" id="cmd" runat="server" />
	<input type="hidden" id="sel" runat="server" />
	<div class="topdiv">
		<a href="ColumnList.aspx">栏目管理</a>
		<% foreach (System.Data.DataRow row in posrows)
	 { %>
		&gt;&gt; <a href="ColumnList.aspx?cid=<%=row["colID"]%>"><%=row["colName"]%></a>
		<%
	 } %>
		&nbsp;&nbsp;&nbsp;
		<select id="itemlist" runat="server" onchange="onitemlist()">
			<option>栏目</option>
			<option selected="selected">文档</option>
			<option>评论</option>
		</select>
		&nbsp;&nbsp;&nbsp;
		<input type="button" onclick="window.location='ArticleEdit.aspx?cid=<%=cid%>'" value="新建" />&nbsp;
		<input type="button" onclick="onedit()" value="修改" />&nbsp;
		<input type="button" onclick="ondelete()" value="删除" />&nbsp;
		<input type="button" onclick="window.location='CommentList.aspx?cid=<%=cid%>'" value="评论管理" />&nbsp;
		&nbsp;&nbsp;&nbsp;
	</div>
	<table class="list" cellpadding="0" cellspacing="0">
		<tr>
    	<th class="w30"><input id="ckall" name="ckall" type="checkbox" onclick="chkall(this)"/></th>
		<th class="w40">序号</th>
		<th class="w50">级别</th>
		<th class="w150">发布日期</th>
		<th>标题</th>
		</tr>
		<% foreach (System.Data.DataRow row in rows)
	 { %>
		<tr>
		<td><input type="checkbox" name="chk" value="<%=row["artID"]%>" /></td>
		<td><%=row["n"]%></td>
		<td><%=row["artLevel"]%></td>
		<td><%=row["artUpdateTime"]%></td>
		<td><a href="ArticleEdit.aspx?cid=<%=cid%>&aid=<%=row["artID"]%>"><%=row["artTitle"]%></a></td>
		</tr>
		<%
	 } %>
	</table>
	<div id="pager"></div>
	</form>
</body>
</html>
